package server

import (
	"unsafe"
)

const (
	LOCALHOST = "127.0.0.1"
	ANYHOST   = "0.0.0.0"
	CHARSET   = "utf-8"

	INT_SIZE = int(unsafe.Sizeof(0))
)

const (
	UnknownMessage MessageType = 0
	TextMessage    MessageType = 1
	BinaryMessage  MessageType = 2
	CloseMessage   MessageType = 8
	PingMessage    MessageType = 9
	PongMessage    MessageType = 10
)

type MessageType int

func isBigEndian() bool {
	i := 0x1
	b := (*[INT_SIZE]byte)(unsafe.Pointer(&i))
	if b[0] == 0 { // little
		return false
	}
	return true
}
